home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-03-20 | 5.0 KB | 187 lines | [TEXT/KAHL] |
- /**
- --
- -- App: Getting Started w/QD GX (WWDC)
- --
- --
- -- Version: 1.0 4/93: added all of the calls required to support the "Getting
- -- Started with QuickDraw™ GX" session at the WWDC '93
- -- 3/94: dmh - general cleanup/debugging.
- --
- -- File: Getting Started GX - main.h
- --
- --
- -- Comments: This file contains all of the variable and function declarations used.
- --
- --
- -- Components: Getting Started GX - main.c
- -- Getting Started GX - main.h
- -- Getting Started GX - shapes.c
- -- Getting Started GX - printing.c
- -- Getting Started GX - misc.c
- -- Getting Started QD GX.π.rsrc
- --
- -- The file titled: "Getting Started GX - main.c" contains the code required to
- -- intialize and tear down the QuickDraw GX world, and the event loop.
- --
- -- The file titled: "Getting Started GX - shapes.c" contains of the code used to
- -- create and manipulate the shapes draw into the window.
- --
- -- The file titled: "Getting Started GX - printing.c" contains of the code used to
- -- print the contents of the window.
- --
- -- The file titled: "Getting Started GX - misc.c" contains of the code for the utilities used.
- --
- --
- -- QuickDraw GX
- -- Libraries
- -- Used: This application uses the following QuickDraw GX library code files:
- -- "gxColor library.c", "gxFont library.c", "graphics debug library.c",
- -- "layout library.c", "qd library.c", "gxShape library.c",
- -- "gxTransferMode library.c", and "gxTransform library.c".
- --
- --
- -- Notes: 1) Print this file in landscape for the best results
- -- 2) If you are using THINK C v5.x, I have added THINK markers to navigate the code.
- -- 3) This code was adapted from the "Banana Jr." QuickDraw GX sample.
- --
- --
- -- Author: Pete "Luke" Alexander
- -- Developer Technical Support
- -- AppleLink: DEVSUPPORT
- --
- --
- -- ©1992 - 1993 Apple Computer, Inc.
- -- All rights reserved.
- --
- **/
-
- //
- // The following are expected to be initialized by the application:
- //
-
- extern Rect gWindowQDRect;
- extern Str255 gWindowTitle;
- extern Boolean gDebugging;
- extern Boolean gGiveMeValidation;
- extern long gGraphicsHeapSize;
-
- extern gxStyle gOurStyle;
- extern gxColor gTextColor;
- extern gxTransform gRotatedTransform;
- extern gxPoint gTextLocation;
-
- //
- // All of the previously declared variables are initialized in the "Getting Started GX - shapes.c" file.
- //
-
-
- //
- // The following variable is initialized in"Getting Started GX - main.c" :
- //
- extern Boolean gQuitting;
-
-
- //
- // The following functions are supplied by the application
- // using the shell and are called at the appropriate time.
- //
-
- //
- // Declared in: Getting Started GX - main.c:
- //
- void main(void);
- void EventLoop(void);
- void MyDoEvent(EventRecord *theEvent);
- OSErr MyPrintingEventOverride(EventRecord *anEvent, Boolean filterEvent);
-
- //
- // Declared in: Getting Started GX - shapes.c:
- //
- OSErr DoInitialization(WindowPtr);
- void DoDraw(WindowPtr);
- OSErr DoCreateNew(void);
- void DoDispose(WindowPtr);
- void DoIdle(WindowPtr);
-
- void CreateNewLayoutShape (WindowPtr);
- void AddKanjiToLayout (WindowPtr);
- void PerspectLayout(WindowPtr);
-
- void CreateABlackRectangle (WindowPtr);
- void ColorTheRectangle (WindowPtr);
- void CreateAQ (WindowPtr);
- void OutlineTheQ (WindowPtr);
- void CreateAD (WindowPtr);
- void CreateAG (WindowPtr);
- void CreateAX (WindowPtr);
-
-
- //
- // Declared in: Getting Started GX - misc.c:
- //
- void DoMenuCommand(long menuResult);
- gxJob GetDocJob(WindowPtr);
- gxShape GetDocShape(WindowPtr);
-
-
- //
- // Declared in: Getting Started GX - printing.c:
- //
- void SetUpEditMenuRec(gxEditMenuRecord *);
- OSErr DoFormat(WindowPtr, gxDialogResult *);
- OSErr DoPrinting(WindowPtr);
- OSErr DoPrintLoop(WindowPtr);
- OSErr DoPrintOneCopy(WindowPtr);
- OSErr MyReplaceCollectionItem(void *newData, long collectSize,
- OSType collectType, long collectID,
- Collection whichCollection,
- Ptr *oldData, long *oldDataSize);
-
- //
- // Resource & menu item equates:
- //
- #define rMenuBar 128
- #define mApple 128
- #define iAbout 1
-
- #define mFile 129
- #define iNew 1
- #define iOpen 2
- #define iClose 3
- #define iSave 4
- #define iDocumentSetup 6
- #define iByPageSetup 7
- #define iPrint 8
- #define iPrintOne 9
- #define iQuit 11
-
- #define mEdit 130
- #define iUndo 1
- #define iCut 3
- #define iCopy 4
- #define iPaste 5
- #define iClear 6
-
- #define mGraphics 131
- #define iCreateABlackRectangle 1
- #define iColorTheRectangle 2
- #define iCreateAQ 3
- #define iOutlineTheQ 4
- #define iCreateAD 5
- #define iCreateAG 6
- #define iCreateAX 7
-
- #define mTypography 132
- #define iCreateLayout 1
- #define iAddKanjiToLayout 2
- #define iPerspectLayout 3
-
- //
- // This is the structure we use to hold our private data for each window. We store a handle to one of these beasties
- // in each window's refCon field.
- //
- typedef struct {
- gxJob docJob; // print job for this document.
- gxShape docPage; // page gxShape description for this document.
- } T_Doc, *TP_Doc, **TH_Doc;
-